package main

import (
    "fmt"
)

// 冒泡排序
func bubbleSort(arr []int) []int {
    n := len(arr)
    for i := 0; i < n-1; i++ {
        for j := 0; j < n-i-1; j++ {
            if arr[j] > arr[j+1] {
                arr[j], arr[j+1] = arr[j+1], arr[j]
            }
        }
    }
    return arr
}

func main() {
    arr := []int{1, 4, 22, 50, 31, 21, 33, 6, 10, 12, 7}
    sortedArr := bubbleSort(arr)
    fmt.Println("排序后的数组:", sortedArr)
}